package com.jobpass.common.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jobpass.common.insterface.UserMapper;
import com.jobpass.common.model.User;
import com.jobpass.common.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author JobPass
 * @since 2020-07-17
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Resource
    private UserMapper userMapper;
    @Override
    public List<User> FindAllUser() {
        return userMapper.selectList(null);
    }

    @Override
    public User FindUserById(Long id) {
        return userMapper.selectById(id);
    }

    @Override
    public int DeleteUserById(Long id) {
        return userMapper.deleteById(id);
    }

    @Override
    public int UpdateUserById(User user) {
        return userMapper.updateById(user);
    }

    @Override
    public int SavaUser(User user) {
        return userMapper.insert(user);
    }
}
